# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=pmbootstrap
pkgver=1.22.1
pkgrel=0
pkgdesc="Sophisticated chroot/build/flash tool to develop and install postmarketOS"
url="https://gitlab.com/postmarketOS/pmbootstrap"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 coreutils procps openssl py3-setuptools git"
checkdepends="pytest"
source="$pkgname-$pkgver.tar.gz::https://gitlab.com/postmarketos/pmbootstrap/-/archive/$pkgver/pmbootstrap-$pkgver.tar.gz
	modules-load.conf"
install="$pkgname.post-install"
options="!check" # Tests require chroot etc.

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
	install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/pmbootstrap.conf
}

sha512sums="e8e086716489cc2b325c8d0705d398cd38ea2ec308aeb66c978eec315383bc72f9ae73b7ca89f56e76b1932b550149bafae559a0aabf54e7c8c13bae42042c08  pmbootstrap-1.22.1.tar.gz
f8026ab32234b885e69252459047f70160c54319113bc449000aa7c05bd016f00a46cee05c8f5251682f967ab44a12c06fbbb3c02d0a57ccb836cff810ce1a40  modules-load.conf"
